<?
include"../inc/config.inc.php";
if($_POST[MODE]=="ADD")
{
$admin_name=$_POST[admin_name];
$admin_pass=$_POST[admin_pass];
$sql="insert into admin(admin_name,admin_pass) values('$admin_name','$admin_pass')";
mysql_query($sql) or die (mysql_error());
echo"<meta http-equiv='refresh' content='0;URL=data_admin.php'>";
}
if($_GET[MODE]=="DEL")
{
$admin_name=$_GET[admin_name];
$admin_pass=$_GET[admin_pass];
$sql="delete from admin where admin_name='$admin_name'";
mysql_query($sql) or die (mysql_error());
echo"<meta http-equiv='refresh' content='0;URL=data_admin.php'>";
}
if($_POST[MODE]=="EDIT")
{
$admin_name=$_POST[admin_name];
$admin_pass=$_POST[admin_pass];
$sql="UPDATE admin set admin_name='$admin_name',admin_pass='$admin_pass' where admin_name='$admin_name'";
mysql_query($sql) or die (mysql_error());
echo"<meta http-equiv='refresh' content='0;URL=data_admin.php'>";
}
?>